package artibella.media.video
{
	import artibella.media.events.InfoEvent;
	
	import flash.events.EventDispatcher;
	
	/**
	 * ...
	 * @author pbordachar
	 */

	public class NetStreamClient extends EventDispatcher
	{
		private var _duree:int;
		
		public function NetStreamClient(){ }
		
		// - - -
		
		public function onMetaData( info:Object ):void 
		{
			_duree = info.duration;
			
			//for ( var i:* in info ) {
				//trace( i, " = ", info[ i ] );
			//}
			
			dispatchEvent( new InfoEvent( InfoEvent.METADATA, info ) );
		}
		
		public function onXMPData( tab:Array ):void
		{
			trace( "onXMPData" );
		}
		
		public function onImageData( info:Object ):void
		{
			trace( "onImageData" );
			trace( info );
		}
		
		public function onTextData( info:Object ):void
		{
			trace( "onTextData" );
			trace( info );
		}
		
		public function onPlayStatus( info:Object ):void
		{
			trace( "onPlayStatus" );
			trace( info );
		}
		
		public function onCuePoint( info:Object ):void
		{
			trace( "onCuePoint" );
			trace( info );
		}
		
		// streaming
		
		public function onBWDone( ... rest ):void 
		{ 
			var p_bw:Number; 
			if ( rest.length > 0 ) 
			{
				p_bw = rest[0]; 
				trace("bandwidth = " + p_bw + " Kbps."); 
			}
		}
		
		/// ---
		
		public function get duree():int
		{
			return _duree;
		}
	}
}